package com.liu.manager.mapper;

import com.liu.manager.entity.SysRolerGroup;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SysRolerGroupMapper {

    @Insert("insert into sysrolergroup(groupname,create_time,update_time,status) values(#{groupName},#{createTime},#{updateTime},#{status})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    int insertRolerGroup(SysRolerGroup sysRolerGroup);

    @Delete("delete from sysrolergroup where id=#{id}")
    int deleteRolerGroup(long id);

    @Update("update sysrolergroup set groupname=#{groupName},update_time=#{updateTime} where id=#{id}")
    int updateRolerGroup(SysRolerGroup sysRolerGroup);

    @Select("select  * from sysrolergroup where id=#{id}")
    SysRolerGroup findById(long id);

    @Select("select * from sysrolergroup where status=1")
    List<SysRolerGroup> findALL();
}
